/*
 * TransactionMessageTemp.java    0.0.1    28/set/2009
 * 
 * Copyright (c) 2009 mentalsmash.org
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * The use of the Apache License does not indicate that this project is
 * affiliated with the Apache Software Foundation.
 */ 
package org.mentalsmash.tazio.core.test.messages.mock;

import org.mentalsmash.tazio.core.identifiers.IdentifiersFactory;
import org.mentalsmash.tazio.core.messages.TazioMessage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * TransactionMessageTemp is a temporary implementation of the abstract class TazioMessage.
 * This class, as for now, is used only for testing the consistency of the Tazio system, 
 * it implements one hypothetical message that could be dispatched throught the system, it 
 * provides two temporary fields: payload and body, both helded by a String value.
 * Objects of this class derive their identifier from their superclass TazioMessage. 
 * This subclass of TazioMessage implements the interface 
 * {@link org.mentalsmash.tazio.org.networking.dispatcher.MessageEvent 
 * MessageEvent<TransactionMessageListener>} in order to give a dispatcher the 
 * possibility to dispatch the message to the listeners interested to this kind of 
 * message.
 * 
 * @version    0.0.1    28/set/2009   
 * @author Enrico Savioli	<savioli.enrico@gmail.com>
 * @see {@link org.mentalsmash.tazio.networking.dispacther.MessageEvent MessageEvent} 
 */
public class TransactionMessageTemp  extends TazioMessage{

	/**
	 * 
	 */
	private static final long serialVersionUID = 190627920206576237L;

	private final static Logger log = LoggerFactory.getLogger(IdentifiersFactory.class);
	
	private String payload;
	private String body;
	
	/**
	 * TransactionMessageTemp() is the default constructor of a TransactionMessageTemp 
	 * object, it does nothing except invoking the superclass constructor, thus giving 
	 * an unique value to the id of the message.
	 */
	public TransactionMessageTemp()
	{
		super();
	}
	
	/**
	 * This is the one-parameter constructor for TransactionMessageTemp messages. It accepts 
	 * a String as input and sets the payload field to the provided value.
	 * 
	 * @param payload	the payload of the message
	 */
	public TransactionMessageTemp(String payload)
	{
		this.payload = payload;
	}
	
	/**
	 * This is the two-parameters constructor for TransactionMessageTemp messages. It accepts 
	 * two Strings as input and sets the payload field to the value of the first input 
	 * parameter and the body to the value of the second provided input.
	 * 
	 * @param payload	the payload of the message
	 * @param body		the body of the message
	 */
	public TransactionMessageTemp(String payload, String body)
	{
		this.payload = payload;
		this.body = body;
	}
	
	public void setPayload(String payload){
		this.payload = payload;
	}
	
	public void setBody(String body){
		this.body = body;
	}
	
	public String getPayload(){
		return payload;
	}
	
	public String getBody(){
		return body;
	}
	
}
